package com.fs.chatx.module.chat.entity;
import lombok.Data;
import org.dromara.easyes.annotation.IndexField;
import org.dromara.easyes.annotation.IndexId;
import org.dromara.easyes.annotation.IndexName;
import org.dromara.easyes.annotation.Settings;
import org.dromara.easyes.annotation.rely.FieldType;
import org.dromara.easyes.annotation.rely.IdType;

import java.time.LocalDateTime;

@Data
@Settings(shardsNum = 3, replicasNum = 2)
@IndexName(value = "chat_session",keepGlobalPrefix = true)
public class ChatSession {
    /**
     * es中的唯一id
     */
    @IndexId(type= IdType.CUSTOMIZE)
    private String sessionId;

    private String userId;
    private String title;
    private String summary;
    @IndexField(fieldType = FieldType.DATE, dateFormat = "epoch_millis")
    private LocalDateTime createTime;
    @IndexField(fieldType = FieldType.DATE, dateFormat = "epoch_millis")
    private LocalDateTime  updateTime;

    // 新增会话状态字段
    private Integer status;
}
